<template>
  <div>
    <el-row>
      <el-col :span="16"
        ><ElMenu
          :default-active="activeIndex"
          class="el-menu-demo"
          mode="horizontal"
          @select="handleSelect"
          active-text-color="#ff0256"
          text-color="#222"
          router
        >
          <ElMenuItem index="1" :route="{ name: 'elementHome' }"
            >首页</ElMenuItem
          >
          <ElMenuItem index="2" :route="{ name: 'elementLogin' }"
            >登录</ElMenuItem
          >
          <ElMenuItem
            index="3"
            :route="{ name: 'elementRegister' }"
            menu-position="right"
          >
            注册
          </ElMenuItem>
        </ElMenu>
      </el-col>
      <el-col :span="8">
        <span v-if="username">
          欢迎：<strong>{{ username }}</strong>
          <button type="info">注销</button>
        </span>
      </el-col>
    </el-row>

    <router-view></router-view>
  </div>
</template>

<script>
export default {
  data() {
    return {
      username: "",
      activeIndex: "1",
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>

<style>
.el-row {
  /* background-color: #545c64; */
}
</style>
